import datetime
from settings.publicvar import Base
from sqlalchemy.orm import Mapped, mapped_column, relationship
from sqlalchemy import String, ForeignKey
from typing_extensions import Annotated

from views.person.model.person import PersonBaseInfo

int_pk = Annotated[int,mapped_column(primary_key=True)]
date_set = Annotated[datetime.date,mapped_column(nullable=True)]

class LearningExperience(Base):
    __tablename__ = 'learningexperience'

    id: Mapped[int_pk]
    name_id: Mapped[int] = mapped_column(ForeignKey('personbaseinfo.id'))
    start_date:Mapped[date_set]
    end_date:Mapped[date_set]
    school:Mapped[str]
    education_qualifications:Mapped[str]
    professional:Mapped[str]
    degreen: Mapped[str]
    degreen_name:Mapped[str]
    degreen_number:Mapped[str]
    education_mode:Mapped[str]
    school_year: Mapped[str]
    graduate_number: Mapped[str]
    witness:Mapped[str]
    mark:Mapped[str] = mapped_column(nullable=True)

    personbase:Mapped[PersonBaseInfo] = relationship(lazy=False,backref='learningexperiences')
